const User = require('../db/modules/User')
const login = async (u, p) => {
  let searchObj = {}
  if (u) searchObj.username = u
  if (p) searchObj.password = p
  const res = await User.findOne(searchObj)
  if (res) {
    return res
  } else false
}
module.exports = login
